<?php defined('SYSPATH') or die('No direct script access.');

class Controller_Admin_Country extends Controller {
    //保存数据
    public function action_saveInfo(){

        $id=$this->request->post('model_id');

        $name=$this->request->post('name');

        $model=new Model_Admin_Country();

        echo $model->saveInfo($id,$name);
    }
    //删除数据
    public function action_deleteInfo(){

        $id=$this->request->post('id');

        $model=new Model_Admin_Common();

        echo $model->deleteInfo("country",$id);
    }
    //根据id加载数据
    public function action_loadInfoById(){

        $id=$this->request->post('id');

        $sql="select t.countryid model_id,t.name
            from country t
            where t.countryid='$id'
            limit 1";

        $model=new Model_Admin_Common();
        
        echo $model->loadInfoById($sql);
    }
}
?>